package com.mt.roll.core.dal.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 员工表
 * </p>
 *
 * @author mt
 * @since 2022-03-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_worker")
public class Worker extends Model<Worker> {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
      @TableId("id")
    private Long id;

    /**
     * 编码,工号
     */
    @TableField("code")
    private String code;

    /**
     * 姓名
     */
    @TableField("name")
    private String name;

    /**
     * 性别:0 、男，1、女
     */
    @TableField("sex")
    private Integer sex;

    /**
     * 入职时间
     */
    @TableField("entry_time")
    private LocalDateTime entryTime;

    /**
     * 电话
     */
    @TableField("telephone")
    private String telephone;

    /**
     * 微信号
     */
    @TableField("wechat_code")
    private String wechatCode;

    /**
     * 邮箱
     */
    @TableField("email")
    private String email;

    /**
     * 角色id，关联数据字典表
     */
    @TableField("role_id")
    private Long roleId;

    /**
     * 所属车间
     */
    @TableField("workshop")
    private String workshop;

    /**
     * 是否在岗:0 、不在岗，1、在岗
     */
    @TableField("on_duty")
    private Integer onDuty;

    /**
     * 描述
     */
    @TableField("description")
    private String description;

    /**
     * 外部编码，用于对照外部系统的编码
     */
    @TableField("external_code")
    private String externalCode;

    /**
     * 启用状态:0 、停用，1、启用
     */
    @TableField("enabled")
    private Integer enabled;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 删除标志，是否有效:1 可用 0不可用
     */
    @TableField("valid")
    @TableLogic
    private Integer valid;

    /**
     * 创建人
     */
    @TableField("creator_id")
    private Long creatorId;

    /**
     * 创建人姓名
     */
    @TableField("creator_name")
    private String creatorName;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @TableField("updater_id")
    private Long updaterId;

    /**
     * 更新人姓名
     */
    @TableField("updater_name")
    private String updaterName;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 版本号
     */
    @TableField("version")
    @Version
    private Integer version;


    public static final String ID = "id";

    public static final String CODE = "code";

    public static final String NAME = "name";

    public static final String SEX = "sex";

    public static final String ENTRY_TIME = "entry_time";

    public static final String TELEPHONE = "telephone";

    public static final String WECHAT_CODE = "wechat_code";

    public static final String EMAIL = "email";

    public static final String ROLE_ID = "role_id";

    public static final String WORKSHOP = "workshop";

    public static final String ON_DUTY = "on_duty";

    public static final String DESCRIPTION = "description";

    public static final String EXTERNAL_CODE = "external_code";

    public static final String ENABLED = "enabled";

    public static final String REMARK = "remark";

    public static final String VALID = "valid";

    public static final String CREATOR_ID = "creator_id";

    public static final String CREATOR_NAME = "creator_name";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATER_ID = "updater_id";

    public static final String UPDATER_NAME = "updater_name";

    public static final String UPDATE_TIME = "update_time";

    public static final String VERSION = "version";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
